<?= $this->partial('groups/menu.phtml'); ?>

<br/>

<div class="content-full">

<?php if ($this->group) :?>

<h1>Grants: <?= $this->group->name ?></h1>

<table width='100%' class='shaded'>

<tr>
	<th colspan='2'>Grants</th>
</tr>

<?php foreach($this->rights as $right) : ?>

	<? $granted = @$this->grants[$right->handle] ? true : false; ?>
	<tr class="<?= $this->alternator(array("odd","even")); ?>">
		<td>
			<? if($granted) : ?>
				<b><?= $right->name ?> (<?= $right->handle; ?>)</b>
			<? else: ?>
				<em><?= $right->name ?> (<?= $right->handle; ?>)</em>
			<? endif; ?>
			<br/>
			<span class="small_text">
			<?= $right->description ?>
			</span>
		</td>
		<td width="200">
			<? if($granted) : ?>
				<a href="<?= $this->route("groups", "revoke", array("group"=>$this->group->id, "handle"=>$right->handle)); ?>">Revoke</a>
			<? else: ?>
				<a href="<?= $this->route("groups", "grant", array("group"=>$this->group->id, "handle"=>$right->handle)); ?>">Grant</a>
			<? endif; ?>
		</td>
	</tr>
	
<? endforeach; ?>
	
</table>

<?php else: ?>
<h1>No Group</h1>
<p>Cannot find group.</p>
<?php endif;?>

</div>